﻿using System;
using System.Text;
using mfRCF.Core;
using mfRCF.Core.Extensions;
using mfRCF.Rss;
using Microsoft.SPOT;
using mfXmlSerializer;

namespace mfRCF.NetduinoPlus2.TestApp
{
    public class DateGetCommand : mfRcfCommand
    {
        public DateGetCommand(string httpPath)
            : base(httpPath, new mfGETMethod()) 
        {
            ContentTypeOut = "text/plain";
        }


        public override void ExecuteCommand(mfIHttpContext httpContext)
        {
            //write response
            httpContext.Response.ContentType = ContentTypeOut;
            httpContext.Response.StatusCode = enumHttpStatusCode.OK;

            httpContext.Response.WriteString(DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss"));

            httpContext.Response.Close();

            Debug.Print(GetType() + " executed, " + Debug.GC(false) + " bytes free");

        }
    }
}
